
import {getuser} from '@/api/index.js'
/**
 * 将用户跳转到微信公共平台获取用户信息
 */
const gotoH5WxPlatformLoginUrl = () => {
	let url = 'https://dev.h5.zzqz2024.com/wx_shouquan1/#/?targetUrl=' + encodeURIComponent(
		window.location.href);
	console.log('gotoH5WxPlatformLoginUrl', url)

	window.location.href = url;
}
const initUserId = (code) => {

	
	getuser({code:code}).then((res)=>{
		setUserId(res.data.accessToken)
	})

}
const getUserId = () => {
	return uni.getStorageSync('userId')
}
const setUserId = (userId) => {
	uni.setStorageSync('userId', userId)
}
export default {

	gotoH5WxPlatformLoginUrl,
	initUserId,
	getUserId,
	setUserId

}